UnitTestTrainer

open class UnitTestTrainer(val minLevel: Level = Level.VERBOSE, showTimestamp: Boolean = true) : Trainer(source)

UnitTestTrainer handles simple console logging during tests on iOS.

This trainer provides clean, uncolored output during tests using NSLog(). Unlike NSLogTrainer, it adds configurable timestamps and structured level labels, making it easier to read test output at a glance.

Since

0.2.0

Parameters

minLevel

Minimum log level to output (defaults to VERBOSE - shows all)

showTimestamp

Whether to include timestamps in output (defaults to true)

Constructors

Link copied to clipboard
constructor(minLevel: Level = Level.VERBOSE, showTimestamp: Boolean = true)

Properties

Link copied to clipboard
open override val minLevel: Level
Link copied to clipboard
override val pack: Pack

The Pack that this Trainer belongs to, which will be used to find duplicative trainers and avoid duplicative log messages.

Functions

Link copied to clipboard
open override fun handle(level: Level, tag: String, message: String, throwable: Throwable?)

Handle a log message by outputting it via NSLog during tests.